<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>免邮产品管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
</head>
<body>
	<div class="container">
        <div class="flow">
            <div class="itemtitle">
                <h3>免邮产品管理</h3>
                <ul>
                    <li><a href="<{$config.weburl}>/admin/module.php?m=activity&s=free_shipping_express.php"><span>免邮列表</span></a></li>
                    <li class="current"><a href="javascript:;"><span>所有产品</span></a></li>
                    <li><a id="activity_button" href="javascript:;"><span>添加产品</span></a></li>
				</ul>
            </div>
        </div>
        <div class="h35"></div>  
		<script type="text/javascript">
        $(function(){
            /* 全选 */
             $('.checkall').click(function(){
                var _self = this;
                $('.checkitem').each(function(){
                    if (!this.disabled)
                    {
                        $(this).attr('checked', _self.checked);
                    }
                });
                $('.checkall').attr('checked', this.checked);
            });	 
        });
        </script>
        
        <form action="" method="get">
	    <input type="hidden" name="m" value="activity">
	    <input type="hidden" name="s" value="free_shipping_product.php">
	    <input type="hidden" name="editid" value="<{$smarty.get.editid}>">
	    <table>
	        <tbody>
	            <tr>
					<td width="50">仓库:</td>
					<td width="100">
						<select name="stock_shop" id="stock_shop" style="float:left;">
		                <option value="" <{if $general_shop!=0}>disabled<{/if}>>全部</option>
		                <{foreach item=list from=$stock_shops}>
		                <option value="<{$list.id}>" <{if $smarty.get.stock_shop==$list.id}>selected<{/if}> <{if $general_shop!=0&&$general_shop!=$list.id}>disabled<{/if}>><{$list.title}></option>
		                
		                <{/foreach}>
		                </select>
					</td>
					<td width="50">产品ID:</td>
            		<td width="100"><textarea name="product_id" style="resize:horizontal;height:30px;"><{$smarty.get.product_id}></textarea></td>
	                <td width="100"><input type="image" src="<{$config.weburl}>/image/admin/search.gif" /></td>
	            </tr>
	            
	        </tbody>
	    </table>
	    </form>
        
        <form action="" method="post">
        <table class="table">
            <tbody>
                <tr class="header partition">
                    <th width="30"></th>
                    <th width="50">显示顺序</th>
                    <th width="50">产品ID</th>
                    <th width="70">产品编号</th>
                    <th colspan="2">产品名称</th>
                    <th width="100">产品分类</th>
                    <th width="100">产品标签</th>
            		<th width="100">所属品牌</th>
                    <th width="70">销售价</th>
            		<th width="70">吊牌价</th>
            		<th width="70">市场价</th>
                </tr>
                <{foreach item=list key=key from=$de.list}>
				<tr>
					<td><input type="checkbox" value="<{$list.id}>" class="checkitem" name="chk[]"></td>
					<td><input type="text" class="w50" name="displayorder[<{$list.id}>]" value="<{$key+1}>" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" onkeyup="value=value.replace(/[^\d]/g,'')"/></td>
                    <td><{$list.id}></td>
                    <td><{$list.code}></td>
                    <td width="50"><div class="img"><img width="50" src="<{$list.pic}>"></div></td>
                    <td style="position:relative;">
                    <{if $list.stock_shop}><i style="background:url(/image/admin/<{$list.stock_shop}>.png);display: block;height: 32px;right: 1px;top:14px;position: absolute;width: 32px;"></i><{/if}>
                    <a href="../?m=product&s=detail&id=<{$list.product_id}>" target="_blank"><{$list.pname}></a></td>
                    <td><{$list.cat}></td>
                    <td><{$list.tagnames}></td>
                    <td><{$list.brand}></td>
                    <td><{$config.money}> <{$list.price}></td>
                    <td><{$config.money}> <{$list.show_price}></td>
                    <td><{$config.money}> <{$list.market_price}></td>
               </tr>
                <{foreachelse}>
                <tr>
                    <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
                </tr>
                <{/foreach}>
            </tbody>
            <tfoot>
                <tr>
                	<td colspan="4">
                        <input type="checkbox" class="checkall" id="del">
                        <input name="act" type="hidden" value="op">
                        <input name="submit" type="submit" value="提交">
                        <input name="submit" type="submit" onclick="return confirm('确定删除吗');" value="<{$lang.del}>">
                    </td>
                    <{if $de.page}>
                    <td colspan="7"><div class="page"><{$de.page}>共有<{$countpro}>个记录 每页显示<input type="text" style="width:30px;" id="page_size" value="<{$smarty.get.page_size}>">条<input type="button" value="确定" onclick="location.href='?m=activity&s=free_shipping_product.php<{$cond}>&page_size='+$('#page_size').val()"></div></td>
                    <{/if}>
                    <td><a href="javascript:showProductIds('<{$productIds}>');">导出产品ID</a></td>
                </tr>
            </tfoot>
        </table>
        </form>
    </div>
<script>
$('#activity_button').click(function(){
	window.parent.iframe_form("activity", '免邮产品管理', 'module.php?m=activity&s=free_shipping_product.php&type=addPro&id=<{$smarty.get.editid}>', 1000, 600);
	return false;
});
function showProductIds(proIds){
	var html = "<textarea style='width:600px;height:300px;' readonly>"+proIds+"</textarea>";
	window.parent.html_form('productId','商品ID',html,600);
}
</script>    
</body>
</html>